package com.fourth.controller.api;

import com.fourth.service.UserInfoService;
import com.ljx.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 蒋一飞
 * @adte 2023/2/27 21:00
 */
@RestController
@RequestMapping("vip/api/user")
public class APIUserInfoController {
    @Autowired
    private UserInfoService userInfoService;
    /**
     * 查询会员信息
     */
    @PostMapping("getUserAll")
    public Result getUserAll(@RequestParam(name = "currentPage", defaultValue = "1")Integer currentPage,
                             @RequestParam(name = "pageSize",defaultValue = "5")Integer pageSize,
                             String startTime,
                             String endTime){


        System.out.println("16942923764"+startTime);
        System.out.println("16942923764"+endTime);
//
        return  userInfoService.getUserInfo(currentPage, pageSize, startTime, endTime);

    }

    /**
     * 通过用户id修改会员状态
     * @param id
     * @param status
     * @return
     */
    @PostMapping ("updateByid")
    public Result updateByid(@RequestParam String id, @RequestParam Integer status ){

        return userInfoService.updateUserInfo(id, status);

    }
}
